// webpack 配置 node.js 文件 

const path = require('path')
module.exports = {
    //1. 给路径起别名
    // chainWebpack: callback(config)
    chainWebpack: config => {
        // config.resolve.alias.set(pathName,绝对路径)
        config.resolve.alias
            .set('components', path.resolve(__dirname, './src/components'))
            .set('views', path.resolve(__dirname, './src/views'))
            .set('assets', path.resolve(__dirname, './src/assets'))
            .set('utils', path.resolve(__dirname, './src/utils'))
    },
    devServer: {
        proxy: {
            '/api': {
                target: 'https://webservice.juanpi.com',
                changeOrigin: true
            },
            '/cate':{
                target:'https://m.juanpi.com',
                changeOrigin: true
            }
        }
    }
}